
package com.kugou.game.sdk.ui.widget;

import android.content.Context;
import android.graphics.Canvas;
import android.graphics.DashPathEffect;
import android.graphics.Paint;
import android.graphics.Path;
import android.graphics.PathEffect;
import android.util.AttributeSet;
import android.view.View;

import com.kugou.game.sdk.utils.AppUtil;
import com.kugou.game.sdk.utils.Rx;

public class DashedLineVertical extends View {

    private Context mContext;

    public DashedLineVertical(Context context, AttributeSet attrs) {
        super(context, attrs);
        mContext = context;
    }

    @Override
    protected void onDraw(Canvas canvas) {
        // TODO Auto-generated method stub
        super.onDraw(canvas);
        Paint paint = new Paint();
        paint.setStyle(Paint.Style.STROKE);
        paint.setColor(getResources().getColor(Rx.color.kg_common_gray_cccccc));
        Path path = new Path();
        path.moveTo(0, 0);
        path.lineTo(AppUtil.getScreenSize(mContext)[0], 0);
        PathEffect effects = new DashPathEffect(new float[] {
                10, 5, 10, 5
        }, 1);
        paint.setPathEffect(effects);
        canvas.drawPath(path, paint);
    }
}
